import http from "../utils/http2.js";

/**
 * 查询部门
 * @param {} data
 */
function queryDept(data) {
  return http.post("/v1/dept/query", data);
}

/**
 * 更新部门状态
 * @param {*} id
 * @param {*} status
 */
function changeDeptStatus(id, status) {
  return http.put("/v1/dept/status?id=" + id + "&status=" + status);
}
/**
 * 保存部门
 * @param {*} data
 * @returns
 */
function saveDept(data) {
  return http.post("/v1/dept", data);
}

function deleteDept(id) {
  return http.delete("/v1/dept", id);
}

/**
 * 修改部门
 * @param {*} data
 * @returns
 */
function updateDept(data) {
  return http.put("/v1/dept", data);
}

//部门树
function queryTree() {
  return http.get("/v1/dept/tree");
}

export {
  queryDept,
  changeDeptStatus,
  saveDept,
  updateDept,
  deleteDept,
  queryTree
};
